import {request,RequestConfig,HttpRequestMethod,LengyuHttpResponse,PageRequestParam,download,upload}  from '../utils/request'


export interface Car{
  id?:string,
  userId?:string,
  need:string,
  carDate:Date,
  carTime:Date,
  playHours:number,
  gs:number,
  targetLevel:number,
  career:string,
  position:string,
  provide:string,
  createTime?:string,
  updateTime?:string,
}

// 将微信用户信息保存到数据库
export function saveCar(car:Car): Promise<LengyuHttpResponse> {
  car.userId=wx.getStorageSync('userId')
  let requestConfig:RequestConfig={
    url:'/car/saveCar',
    method:HttpRequestMethod.POST,
    data:car,
    token:true,
  }
  return request(requestConfig);
}


export function pageCar(param:PageRequestParam): Promise<LengyuHttpResponse> {
  let requestConfig:RequestConfig={
    url:'/car/page',
    method:HttpRequestMethod.POST,
    data:param,
    token:true,
  }
  return request(requestConfig);
}

// export function takePageCar(param:PageRequestParam): Promise<LengyuHttpResponse> {
//   let requestConfig:RequestConfig={
//     url:'/car/takePageCar',
//     method:HttpRequestMethod.POST,
//     data:param,
//     token:true,
//   }
//   return request(requestConfig);
// }